<template>
  <a-modal
    title="$t('otherViewContent.ck')"
    width="100%"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
  >
    <a-spin :spinning="confirmLoading">
      <WangEditor @change="handleChangeEditor" :value="content"/>
    </a-spin>
  </a-modal>
</template>

<script>
import WangEditor from '../../../components/Editor/WangEditor'

export default {
  components: { WangEditor },
  data () {
    return {
      visible: false,
      confirmLoading: false,
      content: ''
    }
  },
  methods: {
    show (html) {
      this.content = html
      this.visible = true
    },
    handleSubmit () {
      this.visible = false
      this.$emit('ok', this.content)
    },
    handleChangeEditor (val) {
      this.content = val
    },
    handleCancel () {
      this.visible = false
    }
  },
  mounted () {
  }
}
</script>
